package behavioral.iterator.custom;

import behavioral.iterator.MenuItem;

public class DinerMenu {
    MenuItem[] ls;
    int index = 0;
    final int MAX_LENGTH = 10;

    public DinerMenu() {
        ls = new MenuItem[MAX_LENGTH];
    }

    public void addItem(String name, String description, double price) {
        ls[index] = new MenuItem(name, description, price);
        index ++;
    }

    public Iterator<MenuItem> createIterator() {
        return new DinerMenuIterator(ls);
    }
}
